﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace lucere.analysis
{
    /// <summary> Abstract decorator class for a DocIdSet implementation
    /// that provides on-demand filtering/validation
    /// mechanism on a given DocIdSet.
    /// 
    /// <p/>
    /// 
    /// Technically, this same functionality could be achieved
    /// with ChainedFilter (under contrib/misc), however the
    /// benefit of this class is it never materializes the full
    /// bitset for the filter.  Instead, the {@link #match}
    /// method is invoked on-demand, per docID visited during
    /// searching.  If you know few docIDs will be visited, and
    /// the logic behind {@link #match} is relatively costly,
    /// this may be a better way to filter than ChainedFilter.
    /// 
    /// </summary>
    /// <seealso cref="DocIdSet">
    /// </seealso>
    public interface IFilteredDocIdSet : IDocIdSet
    {
        /// <summary> Validation method to determine whether a docid should be in the result set.</summary>
        /// <param name="docid">docid to be tested
        /// </param>
        /// <returns> true if input docid should be in the result set, false otherwise.
        /// </returns>
        bool Match(int paramInt);
    }
}
